#include "negativefilter.h"

NegativeFilter::NegativeFilter()
{
}

//reverse the colors
void NegativeFilter::filter(QImage* image)
{
    for(int y = 0; y < image->height(); y++) {
        for(int x = 0; x < image->width(); x++) {
            int red = 255 - qRed((image->pixel(x, y)));
            int green = 255 - qGreen((image->pixel(x, y)));
            int blue = 255 - qBlue((image->pixel(x, y)));

            image->setPixel(x, y, qRgb(red, green, blue));
        }
    }
}
